<template>
  <div class="app-container">
    <div class="worktablist">
      <span class="name" v-for="(item,index) in worktablist" :class="{active:(indexs==index)}" @click="handleTabs(index)"
        :key="index">{{item.name}}</span>
    </div>
    <div class="workMain">
      <div v-if="indexs==0">
        <Reminders></Reminders>
      </div>
      <div v-if="indexs==1">
        <Complaint></Complaint>
      </div>
      <div v-if="indexs==2">
        <Abnormal></Abnormal>
      </div>
      <div v-if="indexs==3">
        <Refund></Refund>
      </div>

    </div>

  </div>
</template>

<script>
  import Reminders from '@/components/statistics-container/Reminders'
  import Complaint from '@/components/statistics-container/Complaint'
  import Abnormal from '@/components/statistics-container/Abnormal'
  import Refund from '@/components/statistics-container/Refund'
  export default {
    components: {
      Reminders,
      Complaint,
      Abnormal,
      Refund
    },
    data() {
      return {
        indexs: 0, ////订单标签索引
        worktablist: [
          //订单标签切换数据
          {
            name: "催单统计"
          },

          {
            name: "投诉统计"
          },
          {
            name: "异常统计"
          },
          {
            name: "退款统计"
          },
        ],


      }

    },
    methods: {
      handleTabs(item) { //切换订单标签数据
        this.indexs = item;
      }
    }

  }
</script>

<style lang='scss'>
  .app-container {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;

    .worktablist {
      display: flex;
      margin-bottom: 10px;
        cursor: pointer;

      .name {
        padding: 0 15px;
        text-align: center;
        color: #000;
        font-size: 20px;
        line-height: 40px;

        &.active {
          font-size: 20px;
          color: #43a0ff;
          border-bottom: 1px solid #43a0ff;
        }
      }
    }
    .workMain{
      margin-bottom: 20px;
    }

  }
</style>
